package com.example.myproject.redis.redisother.fangan;


import org.springframework.stereotype.Service;

/**
 * Created by xi on 2019/3/2.
 */
@Service
public class RedisReceiver {

    /**
     * 默认message是一个字符串,
     * 默认是一个String
     *
     * MessageListenerAdapter 需要制定一个序列化器，那么这个就是对象呢；
     * RedisReceivermessage1:com.example.myproject.domain.User@1f197290,class====>:class com.example.myproject.domain.User
     RedisReceivermessage1:com.example.myproject.domain.User@7dfe75e5,class====>:class com.example.myproject.domain.User
     * @param message
     */
    public void receiveMessage(Object message) {
        //这里是收到通道的消息之后执行的方法
        System.out.println("RedisReceivermessage1:" + message + ",class====>:" + message.getClass());
        //System.out.println("RedisReceiverRedisReceiverRedisReceiver:"+ JsonUtil.toJson(message));
    }
}